﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;

namespace Disassembler
{
    class DisassmMain
    {
        string _allCode;
        FileReaderClass _reader;


        static void Main(string[] args)
        {
            try
            {
                DisassmMain _main = new DisassmMain();
                //_main.MainMethod(args[1]);
                _main.MainMethod(@"C:\Users\Vetalek\Documents\Visual Studio 2010\Projects\HelloWorld\Release\HelloWorld.exe");
            }
            catch (Exception e)
            {
                var sTrace = new StackTrace(e);
                Console.WriteLine(e.Message + "\nMethod: " + sTrace.GetFrame(0).GetMethod());
            }
            finally
            {
                Console.ReadKey();
            }
        }

        void MainMethod(string inputArg)
        {
            //if (!File.Exists(inputArg) || (inputArg.LastIndexOf(".exe") == null))
            //    throw new Exception("Bad input file");

            //if (!DisassmStruct.LoadDisassmTables())
            //    throw new Exception("Dont' loaded DisassmTables");

            _reader = new FileReaderClass(inputArg);
            var _cod = new CodeReaderClass(inputArg);
            _allCode = _reader.ReadData();

        }
    }
}
